#
# The compiler and its flags
#
CXX= g++ 
INCLUDE=-I ../common
CXXFLAGS= -g -Wall $(INCLUDE)
LIBS= -lnsl
#
# Sources and objects
#
COMMON=../common/error.cc\
       ../common/hrtimer_x86.cc

PROGRAM1=requestor
SRCS1=requestor.cc $(COMMON)
OBJS1=$(SRCS1:.cc=.o)

PROGRAM2=echo
SRCS2=echo.cc $(COMMON)
OBJS2=$(SRCS2:.cc=.o)

PROGRAM=$(PROGRAM1) $(PROGRAM2)

all: $(PROGRAM)

$(PROGRAM1): $(OBJS1)
	$(CXX) $(CXXFLAGS) -o $@ $(OBJS1) $(LIBS)

$(PROGRAM2): $(OBJS2)
	$(CXX) $(CXXFLAGS) -o $@ $(OBJS2) $(LIBS)

clean:
	@echo "Removing objects..."
	rm -f $(PROGRAM) *.o *~ core
